@import "./styles/page-card-horizontal";

html, body, #app {
  height: 100%;
  overflow: hidden;
}

#app {
  position: relative;
  z-index: 0;
}

.plain-rocket-icon {
  font-size: inherit;
}

.app-container {

  height: 100%;
  width: 100%;
  color: plv(text-2);

  * {
    font-family: Inter, -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, noto sans, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif;
  }

  .app-home {

    --app-menu: 225px;
    --app-header: 60px;
    --app-navigator: 30px;

    height: 100%;
    width: 100%;
    position: relative;
    background-color: plv(bg-1);

    .app-menu {
      position: absolute;
      inset: 0 auto 0 0;
      width: calc(var(--app-menu) - 1px);
      background-color: plv(bg-2);
      color: white;
      z-index: 5;
      border-right: solid 1px plv(border-color);
      transition: all ease 300ms;

      &:before {
        display: block;
        content: '';
        height: var(--app-header);
      }
    }

    .app-header-filter {
      position: absolute;
      inset: 0 0 auto 0;
      height: var(--app-header);
      z-index: 6;
      backdrop-filter: blur(8px);
      transition: all ease 300ms;

      &:before {
        content: "";
        position: absolute;
        inset: 0;
        background-color: plv(bg-2);
        pointer-events: none;
        z-index: 1;
        opacity: 0.1;
      }
    }

    .app-header-filter-bg {
      position: absolute;
      inset: 0 0 auto 0;
      height: var(--app-header);
      z-index: 4;
      background-color: plv(bg-2);
      transition: all ease 300ms;
    }

    .app-header {
      position: absolute;
      inset: 0 0 auto 0;
      height: var(--app-header);
      box-sizing: border-box;
      color: plv(text-1);
      display: flex;
      align-items: stretch;
      justify-content: space-between;
      //background-color: plv(bg-2);
      z-index: 7;
      border-bottom: solid 1px plv(border-color);
      transition: all ease 300ms;
    }

    .app-content {
      position: absolute;
      inset: 0 0 0 var(--app-menu);
      box-sizing: border-box;
      z-index: 5;

      .app-content-inner {
        height: 100%;
      }

      .app-page {
        background-color: plv(bg-1);
        min-height: 100%;
      }
    }

    &.app-home-collapse-menu-not-mounted {
      /*@formatter:off*/
    .app-header{transform: translateY(-100%)}
    .app-header-filter{transform: translateY(-100%)}
    .app-header-filter-bg{transform: translateY(-100%)}
    .app-menu{transform: translateX(-100%)}
    /*@formatter:on*/
    }
  }
}

.app-container {
  @include sizeMixin(app-container, ()) {

    font-size: $font-size;

    .page-core-content {
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;

      .page-core-content-result {
        width: 500px;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        & > * + * {
          margin-top: $margin;
        }

        .core-page-title {
          color: plv(primary-2);
          font-size: 2em;
          font-weight: bold;
          font-family: "Segoe UI Black";
        }

        .core-page-message {
          color: plv(text-3);
          margin-bottom: 1em;
        }

        & > svg:first-child {
          height: 200px;
        }
      }
    }

    .micro-page-list-item {
      & > div {
        border-radius: $border-radius;

        & + * {
          margin-top: $margin;
        }
      }

      & > .#{componentName(page-card)} {
        @include sizeMixin(page-card, ()) {
          &.page-card-full {
            height: calc(100% - #{$margin} - var(--app-header));
          }
        }
      }
    }
  }

  &.app-container-dark {
    .core-page-title {
      color: plv(text-1) !important;
    }
  }
}

.app-private, .app-public {
  --app-menu: 0px;
  --app-header: 0px;
  --app-navigator: 0px;

  &, & .app-content, & .app-content-inner {
    height: 100%;
    width: 100%;
  }
}

@include comp(page-card) {
  &.page-navigation {
    display: flex;
    flex-direction: row;
    background-color: plv(bg-2);
    border-bottom: solid 1px plv(border-color);
    position: sticky;
    z-index: 2;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;

    .page-navigation-left {
      display: flex;
      align-items: center;
      background-color: transparent;

      .page-navigation-back {
        display: flex;
        align-items: center;
        justify-content: center;
        color: plv(text-1);
        font-size: 1.4em;
        padding-right: 0.25em;
        cursor: pointer;
      }

      .page-navigation-title {
        font-size: plv(font-size-large);
        color: plv(text-1);
        cursor: pointer;
      }
    }

    .page-navigation-right {
      flex: 1;
      overflow: hidden;
      text-align: right;
      background-color: transparent;
    }

    & + div {
      margin-top: 0 !important;
      border-top-left-radius: 0 !important;
      border-top-right-radius: 0 !important;
    }
  }
}


.app-container {
  @include sizeMixin(app-container, ()) {
    .page-navigation {
      top: calc(var(--app-header));

      .page-navigation-right {
        & > * + * {
          margin-left: $margin;
        }
      }
    }
  }
}
